let path = require('path');
let HtmlWebpackPlugin = require('html-webpack-plugin');

module.exports =  {
    // production
    mode: 'development',
    entry: {
        index: './src/index.js',
    },
    output: {
        filename: '[name].js',
        path: path.resolve('dist')
    },
    devServer: {
        contentBase: 'dist',
    },
    module: {
        rules: [
            {
                test: /\.(jpg|png|gif)$/,
                use: {
                    loader: 'url-loader',
                    options: {
                        limit: 200*200
                    }
                }
            },{
                test: /\.css$/,
                use: ['style-loader', 'css-loader']
            },{
                test: /\.html$/,
                use: 'html-withimg-loader'
            }
        ]
    },
    plugins: [
        new HtmlWebpackPlugin({
            template: './public/index.html',
            filename: 'index.html',
            favicon: './public/Pokeball.ico',
        }),

    ]
}